package com.ruijie.acl;

import java.util.Date;
import java.util.List;
import java.util.Set;

import com.ruijie.foundation.bo.EntityObject;
/**
 * <p>
 * Title: 时间段对象
 * </p>
 * <p>
 * Description: 用于数据库中的时间段表管理
 * </p>
 * <p>
 * Copyright: Copyright (c) 2008
 * </p>
 * <p>
 * Company: Ruijie Co., Ltd.
 * </p>
 * <p>
 * Create Time: 2009-09-14
 * </p>
 * <p>
 * Update Time:
 * </p>
 * <p>
 * Updater:
 * </p>
 * <p>
 * Update Comments:
 * </p>
 *@author ASAI
 */
public class TimeRange extends EntityObject {

	/**
	 * serialVersionUID
	 */
	private static final long serialVersionUID = -1201021582883471747L;
	private String name;
	private String remark = "";
	private Boolean isChanged = false;
	private AclDevice aclDevice;
	private Set<TimeInfo> timeInfos;
	private Boolean deleteFlg = false;
	private Date startDate;
	private Date endDate;
	
	/**
	 * 时间信息列表,与DB无关
	 */
	private List<TimeInfo> timeInfoList;
	
	public Boolean getDeleteFlg() {
		return deleteFlg;
	}

	public void setDeleteFlg(Boolean deleteFlg) {
		this.deleteFlg = deleteFlg;
	}

	public TimeRange() {
	}

	public String getName() {
		return this.name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getRemark() {
		return this.remark;
	}

	public void setRemark(String remark) {
		this.remark = remark;
	}

	public Boolean getIsChanged() {
		return isChanged;
	}

	public void setIsChanged(Boolean isChanged) {
		this.isChanged = isChanged;
	}

	public Set<TimeInfo> getTimeInfos() {
		return timeInfos;
	}

	public void setTimeInfos(Set<TimeInfo> timeInfos) {
		this.timeInfos = timeInfos;
	}

	public AclDevice getAclDevice() {
		return aclDevice;
	}

	public void setAclDevice(AclDevice aclDevice) {
		this.aclDevice = aclDevice;
	}

	public List<TimeInfo> getTimeInfoList() {
		return timeInfoList;
	}

	public void setTimeInfoList(List<TimeInfo> timeInfoList) {
		this.timeInfoList = timeInfoList;
	}
	
	public TimeRange clone(TimeRange timeRange, AclDevice aclDevice){
		TimeRange entity = timeRange;
		if (entity == null || 
				(entity.getId() != null && this.getId() != null 
						&& entity.getId().longValue() == this.getId().longValue())){
			entity = new TimeRange();
		}
		entity.setAclDevice(aclDevice);
		entity.setDeleteFlg(this.getDeleteFlg());
		entity.setIsChanged(this.getIsChanged());
		entity.setName(this.getName());
		entity.setRemark(this.getRemark());
		entity.setAclDevice(aclDevice);
		entity.setStartDate(this.getStartDate());
		entity.setEndDate(this.getEndDate());
		return entity;
	}

	public Date getStartDate() {
		return startDate;
	}

	public void setStartDate(Date startDate) {
		this.startDate = startDate;
	}

	public Date getEndDate() {
		return endDate;
	}

	public void setEndDate(Date endDate) {
		this.endDate = endDate;
	}
}
